import type { PostsModel} from '@/api/model/postsModel';
import { request } from '@/utils/request';

const Api = {
  Edit:'/pages/edit',
  Delete:'/pages/delete',
  Detail:'/pages/detail',
  All:'/pages/list'
};



export function savePages(d:any)
{
  return request.post({
    url:Api.Edit,
    data:d
  })
}


export function deletePages(id:any)
{
  return request.post({
    url:Api.Delete+'?id='+id,
    data:{}
  })
}

export function getPages(id:any)
{
  return request.get<PostsModel>({
    url: Api.Detail+`?id=${id}`,
  });
}

export function getAllPages(d:any)
{
  return request.get<PostsModel>({
    url: Api.All+`?page=${d.current}&pageSize=${d.pageSize}`,
  });
}

